package com.hmall.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.user.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper extends BaseMapper<User> {

    @Select("select * from tb_user where id = #{userId}")
    User findUserByUserId(Long userId);

    @Update("update tb_user set balance = #{balance} where id = #{userId}")
    void updateBalanceByUserId(@Param("userId") Long userId,@Param("balance") Long balance);
}
